Skip to content

Comments

merge dev into master#227

Merged
Tarquinen merged 15 commits intomasterfrom
dev
Jan 6, 2026
Merged

merge dev into master#227
Tarquinen merged 15 commits intomasterfrom
dev

Conversation

@Tarquinen
Copy link
Collaborator

@Tarquinen Tarquinen commented Jan 6, 2026

fix variant support for synthetic messages
fix race condition from trying to prevent injections into internal agents. Currently the system prompt mods aren't injected but synthetic user messages still are for internal agents. Maybe this isn't a problem?

cau1k and others added 15 commits January 5, 2026 21:38
Instead of creating a separate findUserVariant function that iterates
through messages, access the variant directly from the baseMessage
that is already passed to createSyntheticUserMessage.
fix: use variant from baseMessage in synthetic user message
fix: propagate variant to notification messages
The isInternalAgent flag was causing a race condition where concurrent
internal agents (title/summary generators) would set the flag to true,
and normal session message transforms would see the stale value and skip
injecting the prunable-tools list.

This happened because messages.transform runs before system.transform,
so the flag set by system.transform was always stale by the time
messages.transform checked it.

Fix: Remove the flag entirely and only skip system prompt injection for
internal agents (detected in system.transform where it works reliably).
fix: remove isInternalAgent flag due to hook ordering race condition
@Tarquinen Tarquinen merged commit 60bb054 into master Jan 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants